-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatic inverse link #56
Conversation
palday
commented
Aug 19, 2023
- adds a way to create extensions for automatic inverse link determination
- defines such extensions for GLM and MixedModels
- this also allows using analytic deritvatives instead of AD for the difference method
Codecov Report
@@ Coverage Diff @@
## main #56 +/- ##
===========================================
- Coverage 100.00% 99.42% -0.58%
===========================================
Files 4 6 +2
Lines 154 174 +20
===========================================
+ Hits 154 173 +19
- Misses 0 1 +1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be simplified considerably by defining more generics directly in Effects that will then be extended when loading GLM or any package that depends on it.
Co-authored-by: Alex Arslan <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
||
[extensions] | ||
EffectsGLMExt = "GLM" | ||
EffectsMixedModelsExt = ["GLM", "MixedModels"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC this will only be loaded if both MixedModels and GLM are loaded. I don't think that restriction is necessary since MixedModels depends on GLM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤷 I wanted to be explicit
@test all(pred.prediction .≈ eff.vol) | ||
@test all(isapprox.(pred.lower, eff.lower; atol=0.001)) | ||
@test all(isapprox.(pred.upper, eff.upper; atol=0.001)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@test all(pred.prediction .≈ eff.vol) | |
@test all(isapprox.(pred.lower, eff.lower; atol=0.001)) | |
@test all(isapprox.(pred.upper, eff.upper; atol=0.001)) | |
@test pred.prediction ≈ eff.vol | |
@test pred.lower ≈ eff.lower atol=0.001 | |
@test pred.upper ≈ eff.upper atol=0.001 |
Any reason not to test the approximate equality of the arrays directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because we want element-wise approximate equality, which is a stronger condition (the approximate equality of vectors is based on the norm of the difference vector)
@test all(eff_trans.vol .≈ eff.vol) | ||
@test all(isapprox.(eff_trans.lower, eff.lower; atol=0.001)) | ||
@test all(isapprox.(eff_trans.upper, eff.upper; atol=0.001)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@test all(eff_trans.vol .≈ eff.vol) | |
@test all(isapprox.(eff_trans.lower, eff.lower; atol=0.001)) | |
@test all(isapprox.(eff_trans.upper, eff.upper; atol=0.001)) | |
@test eff_trans.vol ≈ eff.vol | |
@test eff_trans.lower ≈ eff.lower atol=0.001 | |
@test eff_trans.upper ≈ eff.upper atol=0.001 |
Same question as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same answer as above
Co-authored-by: Alex Arslan <[email protected]>
Co-authored-by: Alex Arslan <[email protected]>